﻿@model Wiwi.ViewModels.myAccountList
<script type="text/jscript" >
    function ExportData() {
        var dropdown = document.getElementById("interval");
        var index = dropdown.selectedIndex;
        var ddVal = dropdown.options[index].value;
        var ddText = dropdown.options[index].text;
        $('#HidExportval').val(ddVal);
    }
</script>

<div class="grid_6 box-shadow margin-top">
    
    <h4 class="tabbed ">Your Account</h4>
  
    <p class="serif-it margin-left">Your Balance: <strong class="margin-left">@Model.bal.ToString() Credits</strong></p>
    <p class="margin-left"><a href="#" class="yellow-button button-m">Purchase Credits !</a></p>
</div>

<div class="grid_13 box-shadow margin-top">
 <h4 class="tabbed xWide">Account Statement</h4>

@using (Html.BeginForm("MyAccount", "Wantkeyword", FormMethod.Post, null))
{
    <p class="green-button extra-padding">View: 

    <select name="interval">
          <option value="100000">All transaction</option>
          <option value="1440">Last 60 days</option>
          <option value="1080">Last 45 days</option>
          <option value="720">This month</option>
          <option value="360">This fortnight</option>
          <option value="180">This week</option>
          <option value="1">This hour</option>
    </select>
    
    <input type ="submit" value="Go" />
    @* Status if needed // <span>Showing 4 of 4</span> *@
</p>
    
     <table id="clean-table" summary="User's Account Summary">
        <thead>
	    		<tr>
	    			<th>Date</th>   <th>Description</th>    <th>Credit</th> <th>Debit</th>
	    		</tr>
	    </thead>
  
        <tbody>

           @foreach (var tr in Model.acc)
           {
           
            <tr class="odd"><td>@tr.Transactiondate</td>
                <td>@tr.Description</td>
                <td>@if (tr.Purchase > 0)
                    { @tr.Purchase }</td>
                <td>@if (tr.consumption > 0)
                    { @tr.consumption }</td>
            </tr>   
                 
           } 

        </tbody>
   
    </table>
    
}

</div>